import java.util.Scanner;

public class EnergyForWater {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("请输入水的质量（千克）：");
        double mass = input.nextDouble();
        System.out.print("请输入初始温度（℃）：");
        double initialTemp = input.nextDouble();
        System.out.print("请输入终止温度（℃）：");
        double finalTemp = input.nextDouble();

        final double SPECIFIC_HEAT = 4184; // J/(kg·℃)
        double energy = mass * (finalTemp - initialTemp) * SPECIFIC_HEAT;
        System.out.printf("所需能量为 %.1f 焦耳%n", energy);
        input.close();
    }
}